import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/home_bill_details_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class HomeBillDetailsEntity {
	late int code;
	late HomeBillDetailsObj obj;
	late String msg;

	HomeBillDetailsEntity();

	factory HomeBillDetailsEntity.fromJson(Map<String, dynamic> json) => $HomeBillDetailsEntityFromJson(json);

	Map<String, dynamic> toJson() => $HomeBillDetailsEntityToJson(this);

	HomeBillDetailsEntity copyWith({int? code, HomeBillDetailsObj? obj, String? msg}) {
		return HomeBillDetailsEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeBillDetailsObj {
	late String address;
	late List<HomeBillDetailsObjItems> items;
	late double totalMoney;

	HomeBillDetailsObj();

	factory HomeBillDetailsObj.fromJson(Map<String, dynamic> json) => $HomeBillDetailsObjFromJson(json);

	Map<String, dynamic> toJson() => $HomeBillDetailsObjToJson(this);

	HomeBillDetailsObj copyWith({String? address, List<HomeBillDetailsObjItems>? items, double? totalMoney}) {
		return HomeBillDetailsObj()
			..address= address ?? this.address
			..items= items ?? this.items
			..totalMoney= totalMoney ?? this.totalMoney;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeBillDetailsObjItems {
	late String itemName;
	late int feeItemProperty;
	late String detail;
	late double damages;
	late int state;
	late String startDate;
	late String endDate;

	HomeBillDetailsObjItems();

	factory HomeBillDetailsObjItems.fromJson(Map<String, dynamic> json) => $HomeBillDetailsObjItemsFromJson(json);

	Map<String, dynamic> toJson() => $HomeBillDetailsObjItemsToJson(this);

	HomeBillDetailsObjItems copyWith({String? itemName, int? feeItemProperty, String? detail, double? damages, int? state, String? startDate, String? endDate}) {
		return HomeBillDetailsObjItems()
			..itemName= itemName ?? this.itemName
			..feeItemProperty= feeItemProperty ?? this.feeItemProperty
			..detail= detail ?? this.detail
			..damages= damages ?? this.damages
			..state= state ?? this.state
			..startDate= startDate ?? this.startDate
			..endDate= endDate ?? this.endDate;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}